#!/usr/bin/env perl
use strict;
use warnings;

my %hash;

while(my $line = <STDIN>){
	chomp($line);
	my @cols = split(/\t/,$line);
	if(exists($hash{$cols[0]})){
		$hash{$cols[0]} += $cols[1];
	} else {
		$hash{$cols[0]} = 1;
	}
}
while(my($k,$v) = each(%hash)){
	printf("%s\t%s\n",$k,$v);
}
